<script setup>
import { onMounted, onUnmounted, ref } from "vue";
import router from "@/router/index";
import { _$, $ } from "./edit";

const formRef = ref();

onMounted(() => {
  $.loadEdit();
});

onUnmounted(() => {
  $.clean();
});
</script>

<template>
  <el-space direction="vertical" fill wrap class="w-fill" :size="20">
    <el-card class="w-fill" shadow="never">
      <el-descriptions title="基本资料">
        <el-descriptions-item>
          <el-form
            ref="formRef"
            :model="_$.requestParam"
            :rules="_$.rules"
            label-width="auto"
            size="small"
            style="max-width: 600px"
          >
            <el-form-item label="昵称" prop="name">
              <el-input v-model="_$.requestParam.name" />
            </el-form-item>
            <el-form-item label="性别" prop="gender">
              <el-radio-group v-model="_$.requestParam.gender">
                <el-radio :value="0" border>女</el-radio>
                <el-radio :value="1" border>男</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="手机号" prop="phone">
              <el-input v-model="_$.requestParam.phone" />
            </el-form-item>
            <el-form-item label="邮箱" prop="email">
              <el-input v-model="_$.requestParam.email" />
            </el-form-item>
            <el-form-item label="生日" prop="birthday">
              <el-date-picker
                v-model="_$.requestParam.birthday"
                type="datetime"
              />
            </el-form-item>
            <el-form-item label=" ">
              <el-button
                type="primary"
                size="small"
                @click="$.onSubmit(formRef)"
                >提交</el-button
              >
            </el-form-item>
          </el-form>
        </el-descriptions-item>
      </el-descriptions>
    </el-card>
  </el-space>
</template>

<style scoped></style>
